
export const routes = [
    {
        path: '/',
        name: "home-view",
        component: () => import('../views/HomeView.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/register',
        name: '注册',
        component: () => import('../components/Register.vue'),
        meta: {
            needLogin: false,
            roles:['user','admin'],
        }
    },
    {
        path: '/managepost',
        name: '管理帖子',
        component: () => import('../components/ManagePost.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/manageuser',
        name: '管理用户',
        component: () => import('../components/ManageUser.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../components/Login.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/post',
        name: "post",
        component: () => import('../views/Post.vue'),
        children: [{
            path: 'InPost',
            name: '进入广场',
            component: () => import('../components/InPost.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
            path: 'MyPost',
            name: '我的帖子',
            component: () => import('../components/MyPost.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
            path: 'Write',
            name: '发帖子',
            component: () => import('../components/Write.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
            path: 'Article',
            name: '帖子详情',
            component: () => import('../components/Article.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
            path: 'Comment',
            name: '评论',
            component: () => import('../components/Comment.vue'),
            meta: {
                roles:['user','admin'],
            }
        }
        ],

        redirect: {
            name: '进入广场'
        },
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/bottle',
        name: "bottle",
        component: () => import('../views/Bottle.vue'),
        children: [{
            path: 'ThrowBottle',
            name: '扔瓶子',
            component: () => import('../components/ThrowBottle.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
                path: 'GetBottle',
                name: '捞瓶子',
                component: () => import('../components/GetBottle.vue'),
            meta: {
                roles:['user','admin'],
            }
        }, {
            path: 'MyBottle',
            name: '我的瓶子',
            component: () => import('../components/MyBottle.vue'),
            meta: {
                roles:['user','admin'],
            }
        }
        ],
        redirect: {
            name: '扔瓶子'
        },
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/userInfo',
        name: "userInfo",
        component: () => import('../views/UserInfo.vue')
    },
    {
        path: '/manage',
        name: "manage",
        component: () => import('../views/Manage.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/menu',
        name: "menu",
        component: () => import('../components/Menu.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/menu0',
        name: "menu0",
        component: () => import('../components/Menu0.vue'),
        meta: {
            roles:['user','admin'],
        }
    },
    {
        path: '/PostAside',
        name: "PostAside",
        component: () => import('../components/PostAside.vue'),
        meta: {
            roles:['user','admin'],
        }
    }
]
